package lab02.text07;
import java.util.Random;
import java.util.Scanner;

public class text {
    public static void main(String[] args) {
        int number = new Random().nextInt(100) + 1;

        Scanner sc = new Scanner(System.in);
        int innumber = 0;

        while (innumber != number) {
            System.out.println("请输入1~100之间你猜测的数字");
            innumber = sc.nextInt();

            if (innumber > number) {
                System.out.println("猜大了");
            } else if (innumber < number) {
                System.out.println("猜小了");
            }

            if (innumber == number) {
                System.out.println("猜对了，数字为：" + number);
            }
        }


    }
}
